package com.heima.admin.controller;

import com.heima.admin.service.UserService;
import com.heima.model.admin.dtos.AdUserDto;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author shiminghui
 * @date 2024/12/17 20:57
 * @description: TODO
 */
@RestController
@RequestMapping
public class LoginController {

    @Autowired
    private UserService userService;

    /**
     * 登录
     *
     * @param adUserDto
     * @return
     */
    @PostMapping("/login/in")
    public ResponseResult login(@RequestBody AdUserDto adUserDto) {
        ResponseResult result = userService.login(adUserDto);
        return result;
    }
}
